package com.xingchi.tornado.dict.config;

import com.xingchi.tornado.dict.enums.DictStorageTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import static com.xingchi.tornado.dict.config.DictProperties.DICT_CONFIG_PREFIX;

/**
 * 字典配置
 *
 * @author xingchi
 * @date 2024/5/19 20:33
 */
@Data
@ConfigurationProperties(prefix = DICT_CONFIG_PREFIX)
public class DictProperties {

    public static final String DICT_CONFIG_PREFIX = "xingchi.tornado.dict";
    public static final String DICT_SERVICE_STORAGE_TYPE = DICT_CONFIG_PREFIX + ".storage-type";
    public static final String DICT_REFRESH = DICT_CONFIG_PREFIX + ".refresh";

    /**
     * 是否刷新，默认为false
     */
    private boolean refresh = false;

    /**
     * 字典包扫描，默认为com.xingchi.tornado
     */
    private String basePackage = "com.xingchi.tornado";

    private String ignoreSuffix = "enum";

    /**
     * 字典数据存储类型，默认存储在内存中
     */
    private DictStorageTypeEnum storageType = DictStorageTypeEnum.IN_MEMORY;

}
